package com.neoharvest.smartagri.chain.impl;

import com.neoharvest.smartagri.chain.SafetyHandler;

public class ObstacleHandler implements SafetyHandler {
    private SafetyHandler nextHandler;

    @Override
    public void setNextHandler(SafetyHandler nextHandler) {
        this.nextHandler = nextHandler;
    }

    @Override
    public void handleRequest(String request) {
        if (request.contains("obstacle")) {
            System.out.println("ObstacleHandler: Handling obstacle detection");
        } else if (nextHandler != null) {
            nextHandler.handleRequest(request);
        }
    }
}